﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Core.Entities.InGame;
using Young3.FMSearch.Core.Managers;
using System.Runtime.InteropServices;
using PostSharp.Extensibility;
using System.Diagnostics;
using System.Reflection;

namespace Young3.FMSearch.Core.Attributes
{
    /// <summary>
    /// Every ingame property should be marked with this attribute.
    /// The offset (from the beginning of the object in memory) should be
    /// added as then first parameter.
    /// Sometimes for strings, an additional string length should be taken.
    /// </summary>
    [Serializable]
    [MulticastAttributeUsage(MulticastTargets.Method | MulticastTargets.InstanceConstructor | MulticastTargets.StaticConstructor, AllowMultiple = true)]
    [RequirePostSharp("FMSE.FMEntityWeaver", "FMSE.FMEntityWeaver")]
    internal class FMEntityAttribute : MulticastAttribute
    {
        public int Offset { get; internal set; }
        public int AdditionalStringOffset { get; internal set; }

        private Type PropertyReturnType { get; set; }
        private bool IsGetter { get; set; }

        public FMEntityAttribute(int offset, int additionalStringOffset)
        {
            this.Offset = offset;
            this.AdditionalStringOffset = additionalStringOffset;
        }

        public FMEntityAttribute(int offset) : this(offset, 0) { }
    }

}
